package com.desire.common;

import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;


/**
 * 全局异常捕获
 */
@Slf4j
@ControllerAdvice
public class GlobalExceptionIntercepter {

    public Result<Object> handleException(Exception exception) {
        log.error("exception", exception);
        return ResultUtil.error("系统异常");
    }
}
